<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    public function up(): void
    {
        if (Schema::hasColumn('task_applications', 'birth_date')) {
            DB::statement("ALTER TABLE task_applications MODIFY birth_date DATE NULL COMMENT '出生日期'");
        }
    }

    public function down(): void
    {
        if (Schema::hasColumn('task_applications', 'birth_date')) {
            DB::statement("ALTER TABLE task_applications MODIFY birth_date DATE NOT NULL COMMENT '出生日期'");
        }
    }
};
